package model

import (
	"database/sql"
	"time"
)

type IrCron struct {
	ResCommon
	IrActionsServerId int64
	IrActServer       IrActServer `gorm:"foreignKey:Id;references:IrActionsServerId"`
	CronName          string
	UserId            int64
	User              ResUsers
	Active            bool
	IntervalNumber    sql.NullInt64
	IntervalType      sql.NullString
	NumberCall        sql.NullInt64 `gorm:"column:numbercall"`
	DoAll             sql.NullBool  `gorm:"column:doall"`
	NextCall          time.Time     `gorm:"column:nextcall"`
	LastCall          sql.NullTime  `gorm:"column:lastcall"`
	Priority          sql.NullInt64
}

type IrActServer struct {
	ResCommon
	Name             string
	Type             string `gorm:"default:ir.actions.server"`
	ModelId          int64
	ModelName        string
	BindingType      string `gorm:"default:action"`
	BindingViewTypes string `gorm:"default:list,form"`
	Usage            string `gorm:"default:ir_cron"`
	State            string `gorm:"default:code"`
	Sequence         int64  `gorm:"default:5"`
	WebsitePublished sql.NullBool
}
